import VueRouter from "vue-router";
import Vue from "vue";
import Home from "../pages/Home.vue"
import Login from "../pages/Login.vue"
import Detail from "../pages/Detail.vue"
import City from "../pages/City.vue"




// 给vue 安装路由插件
Vue.use(VueRouter)
// 创建路由实例对象
const router = new VueRouter({
    mode:'hash',
    // 配置路由
    routes:[
        // redirect:重定向
        {path:'/',redirect:'/home'},
        // 配置路由器规则
        {path:'/home' , name:'home' , component:Home},
        {path:'/detail' , name:'detail' , component:Detail},
        {path:'/login' , name:'login' , component:Login},
        {path:'/city' , name:'city' , component:City}
    ]
})

window.router = router


export default router